import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
      token: window.localStorage.getItem('token_user'),  //存到localStorage中一样
  },
  mutations: {
      LOGIN: (state, data) => {
          //更改token的值
          state.token = data;
          // console.log(data)
          window.localStorage.setItem('token_user', data);
      },
  },
  actions: {
  },
  modules: {
  }
})
